from django.db import models

# Create your models here.
class Order_form(models.Model):
    # 订单号
    order_number = models.CharField(max_length=255,null=False)
    # 收货地址
    shipping_address = models.CharField(max_length=255,null=False)
    # 收货人头像
    message_img = models.CharField(max_length=255)
    # 收货人姓名
    name = models.CharField(max_length=255)
    # 收货人手机号
    phone = models.IntegerField()

class Commodity(models.Model):
    TYPE = (('0','日用'),('1','冷藏'),('2','熟食'),('3','零食'),('4','蔬果'),('5','米面'))
    # 商品名称
    commodity_name = models.CharField(max_length=255,null=False)
    # 生产日期
    date_of_manufacture = models.CharField(max_length=255,null=False)
    # 商品类型
    type_of_merchandise = models.CharField(max_length=1,choices=TYPE)
    # 生产地址
    address = models.CharField(max_length=255,null=False)
    blong = models.ManyToManyField(Order_form, related_name='Order_form_related')

